<template>
  <!-- 页面刷新 -->
  <a-config-provider :locale="locale">
    <!-- <div id="app">
      <router-view />
    </div> -->
    <div id="app">
      <router-view v-if="isRouterAlive"></router-view>
    </div>
  </a-config-provider>
</template>

<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import { AppDeviceEnquire } from '@/utils/mixin'

export default {
  name: 'App',
  mixins: [AppDeviceEnquire],
  provide() {
    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
    return {
      reload: this.reload
    }
  },
  data() {
    return {
      locale: zhCN,
      isRouterAlive: true
    }
  },
  mounted() {},
  methods: {
    reload() {
      this.isRouterAlive = false //先关闭，
      this.$nextTick(function() {
        this.isRouterAlive = true //再打开
      })
    }
  }
}
</script>
<style>
#app {
  height: 100%;
}
.ant-table-thead > tr > th,
.ant-table-tbody > tr > td {
  padding: 2px;
}

/* .ant-menu-item-selected{
    background-color: aqua;
  } */
/* .icon {
       width: 1em; height: 1em;
       vertical-align: -0.15em;
       fill: currentColor;
       overflow: hidden;
    } */
</style>
